//
//  ViewController.m
//  BYTimerDemo
//
//  Created by 崔宝印 on 2018/8/7.
//  Copyright © 2018年 Koolearn. All rights reserved.
//

#import "ViewController.h"
#import "BYTimer.h"

@interface ViewController ()

@property (nonatomic, strong) NSString *timer;

@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
   
}

- (IBAction)startTimer:(id)sender
{
    self.timer = [BYTimer doTask:^{
        NSLog(@"----%@",[NSThread currentThread]);
    } afterDelay:1 timeInterval:1 repeats:YES async:NO];
}

- (IBAction)endTimer:(id)sender
{
    [BYTimer cancelTimer:self.timer];
}

@end
